//
//  HYCPushCityCell.m
//  FamilyTravel
//
//  Created by dllo on 15/10/26.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "HYCPushCityCell.h"
#import "HYCHeadDocument.h"
#define WIDTH self.contentView.frame.size.width
#define HEIFGT self.contentView.frame.size.height
#define SWIDTH [UIScreen mainScreen].bounds.size.width
#define SHEIGHT [UIScreen mainScreen].bounds.size.height
@implementation HYCPushCityCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        
        self.pictureImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIFGT / 1.5833)];
        [self addSubview:self.pictureImageView];
        
        self.scriptLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, HEIFGT / 1.52, WIDTH / 1.16666, HEIFGT / 4.418)];
        
        [self addSubview:self.scriptLabel];
        self.scriptLabel.font = [UIFont systemFontOfSize:13];
        self.scriptLabel.numberOfLines = 0;
        
        self.disLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, HEIFGT / 1.0857, WIDTH / 4, HEIFGT / 10)];
        [self addSubview:self.disLabel];
        self.disLabel.font = [UIFont systemFontOfSize:11];
        self.disLabel.textColor = [UIColor redColor];
//        self.disLabel.backgroundColor = [UIColor blackColor];
        
        self.moneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH / 2, HEIFGT / 1.0795, WIDTH / 2.3, HEIFGT / 10)];
        [self addSubview:self.moneyLabel];
//        self.moneyLabel.backgroundColor = [UIColor blackColor];
        self.moneyLabel.font = [UIFont systemFontOfSize:11];
        self.moneyLabel.textColor = [UIColor redColor];
        
        
    }
    return self;
}

- (void)setModel:(HYCPushCityModel *)model {
    
    if (_model != model) {
        [_model release];
        _model = [model retain];
        [_pictureImageView sd_setImageWithURL:[NSURL URLWithString:_model.photo]placeholderImage:[UIImage imageNamed:@"zw.png"]];
        _scriptLabel.text = _model.title;
        _disLabel.text = _model.priceoff;
        
        NSString *str = [_model.price stringByReplacingOccurrencesOfString:@"<em>" withString:@""];
        NSString *str1 = [str stringByReplacingOccurrencesOfString:@"</em>" withString:@""];
        
        _moneyLabel.text = str1;
        
 
    }
}






@end
